Skip to content

Instantly share code, notes, and snippets.

@cpicanco
cpicanco / Monokai.xml
Last active May 13, 2024 07:31
Dark theme for Lazarus IDE. Copy to "userschemes" inside primary config path
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<Lazarus>
<ColorSchemes Version="11">
<Names Count="1">
<Item1 Value="Monokai"/>
</Names>
<Globals Version="11">
<SchemeMonokai>
<ahaGutter Background="2238503"/>
@mykeels
mykeels / states-and-cities.json
Created April 8, 2018 12:43
Nigerian States and Cities in JSON
[
{
"name": "Abia",
"cities": [
"Aba South",
"Arochukwu",
"Bende",
"Ikwuano",
"Isiala Ngwa North",
"Isiala Ngwa South",
@SebaUbuntu
SebaUbuntu / README.md
Last active May 13, 2024 07:26
Generate framework compatibility matrix from fqnames

Generate framework compatibility matrix from fqnames

  • Download these 2 files
  • Compile AOSP without fcm from stock and wait for check_vintf to error out
  • Delete Python prefix from all lines (e.g. checkvintf E 06-24 00:30:22 49120 49120 check_vintf.cpp:554])
  • Paste the result in fqnames.txt
  • Launch the script

借助git快速批量转换CRLF到LF


换行符的差异

  • windows下每行结尾为回车+换行(CR+LF),即 \r\n
  • unix和macOS下每行结尾为换行LF,即 \n
  • classic macOS(最后一个版本为1999年发布的Mac OS 9,可忽略)下为回车,即 \r

设置jetbrain系IDE

settings > Editor > Code Style > Line Separator > unix and macOS (\n)

@CodeSigils
CodeSigils / ubuntu-remove-telemetry.sh
Last active May 13, 2024 07:24
Remove Ubuntu telemetry
#!/usr/bin/env bash
################ Description: ###################
# This script will disable all opt-out under
# Ubuntu 22.04 (Codename: Jammy Jellyfish).
# At first the telemetry domains will be resolved
# to the local host and second all telemetry services
# will be removed from the system.
# The following work has a system-wide effect not just
@umayr
umayr / recover-deleted-branch.sh
Created April 1, 2016 11:41
How to recover a deleted branch
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}
@ryanlintott
ryanlintott / ContentView.swift
Last active May 13, 2024 07:20
A SwiftUI environment value for the keyboard height that updates with animation. This is useful when you want a specific view in a stack to stick to the bottom of the keyboard when the keyboard moves up.
import SwiftUI
struct ContentView: View {
var body: some View {
KeyboardAvoidingWithOffset()
.keyboardHeightEnvironmentValue()
}
}
struct KeyboardAvoidingWithOffset: View {